<template>
    <div class="newsinfo-container">
        
        <h3 class="title">新闻详情---{{ $route.params.id }}</h3>
        <p class="subtitle">
            <span>发表时间：{{ newsinfo }}</span>
            <span>点击:次</span>
        </p>
        <hr>
        <div class="content"></div>
        <!-- 发表评论区域 -->
        <com-box :id="id"></com-box>
        
        

    </div>
    
</template>
<script>

import { Toast } from "mint-ui"

// 导入子组件
import comment from '../subcomponents/comment.vue'
export default {
    data(){
        return{
            id: this.$route.params.id,
            newsinfo:''
            
        };
    },
    created(){
        console.log(this.$route)
        this.getnewsinfo();


    },
    methods:{
        getnewsinfo(){
                this.$http.get('https://api.apiopen.top/videoRecommend?id=' + this.id).then(result =>{
                console.log(result);
                if(result.status === 200){
                    this.newsinfo = result.body.message;

                }else{
                    Toast('获取失败')

                }
                
            })
        },
       
       
    },
     components:{
            'com-box':comment
        }
    
    
}
</script>
<style lang="scss" scoped>
.newsinfo-container{
    padding: 0 4px;
    .title{ 
        font-size: 16px;
        text-align: center;
        color:red;
        margin:15px;

    }
    .subtitle{
        color:#226aff;
        font-size: 13px;
        display: flex;
        justify-content: space-between;
    }
    .content{}
}

</style>


